<?php
// +----------------------------------------------------------------------
// | huicmf [ huicmf快速开发框架 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2022~2024 https://xiaohuihui.cc All rights reserved.
// +----------------------------------------------------------------------
// | Author: 小灰灰 <762229008@qq.com>
// +----------------------------------------------------------------------
// | Info:
// +----------------------------------------------------------------------
declare(strict_types=1);

namespace app\common\model;

class LinksGroup extends TimeInit
{

    /**
     * 获取数量
     * @return int
     */
    public static function getCount(): int
    {
        $count = self::where(['status' => 1])->count();

        return $count;
    }

    /**
     * 获取数据列表
     * @return array
     */
    public static function getList(int $page = 1, int $limit = 10): array
    {
        $first = ($page - 1) * $limit;
        $list  = self::where(['status' => 1])->limit($first, $limit)->select()->toArray();

        return $list;
    }

}
